<template>
  <div class="box">
      <div class="login">
          <el-input v-model="username" placeholder="请输入账户"></el-input>
          <el-input v-model="password" show-password placeholder="请输入密码"></el-input>
        <el-button type="success" @click="add">登录</el-button>
      </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            username:'',
            password:''
        }
    },
    methods: {
        add(){
            let user=[]
            user.push({
                username:this.username,
                password:this.password
            })
            localStorage.user=JSON.stringify(user)
            this.$router.push({
                path:"/"
            })
        }
    },
}
</script>

<style scoped>
.box{
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.login{
    width: 60vw;
    height: 35vh;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

</style>